<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        p{
            width: 340px;
            height: 50px;
            line-height: 50px;
            font-size: 25px;
            margin: 100px auto;
            background-color: greenyellow;
        }
        
    </style>
</head>
<body>
    <p></p>
    
    <script>
        var  box= document.querySelector('p');
        var day = 100;
        setInterval(function(){
            box.innerHTML = myDate();
        },0)
        function myDate(){
            var date = new Date();
            var hour = date.getHours();
            var minute = date.getMinutes();
            var seconds = date.getSeconds();
            var millis = date.getMilliseconds();
            (minute < 10)? minute = '0' + minute : minute;
            (seconds < 10)? seconds = '0' + seconds : seconds;
            if(hour == 0 ){
                day--;
            }
            console.log(day + '天' + hour + '小时' + minute + '分钟' + seconds + '秒' + millis);
            return day + '天' + (24-hour) + '小时' + (60-minute) + '分钟' + (60-seconds) + '秒' + (999-millis);
        }

    </script>
</body>
</html>